home *** CD-ROM | disk | FTP | other *** search
/ .net 1999 December / netCD65.iso / mac / madasafish / macsw / Internet Setup / Modem Scripts / GV 28.8⁄33.6 for ARA 2.1 OT⁄PPP / GV 28.8_33.6 for ARA 2.1 OT_PPP
Encoding:
Text File  |  1998-03-11  |  15.0 KB  |  745 lines

  1. !  GV Teleport 33.6 for ARA 2.1 - 9/5/96, DEJ
  2. !  Copyright: © 1991-1996 Global Village Communication, Inc.     All Rights Reserved.
  3. !    Portions Authored by: Kris Kreutzman
  4. !    Portions Copyright:    © 1991-1996 Apple Computer, Inc.    All Rights Reserved.
  5. !
  6. !    revision history:
  7. !   1.0.1 9/5/96 djorgensen - Generated basic Apple/Kris Kreutzman script w/MSG 1.0a1.
  8. !                              Integrated earlier/cleaner answer & hangup (rhoiberg),
  9. !                             Platinum mods (SAP), Fax/ARA discrimination (crw), Int'l 
  10. !                             Blacklisting & blind dialing (DEJ), 31.2k & 33.6k (gas).
  11. !                             Added comments, 2.1 features, & better product support.
  12. !   1.0.3 11/15/96 djorgensen - Added TP Speakerphone change.
  13. !  'mlts' resource info for this modem:
  14. !    byte 1 == 01 -> modem HAS built-in error correction protocols
  15. !    byte 2 == 01 -> modem HAS built-in data compression protocols
  16. !    byte 3 == 40 -> max number of chars (hex 28) in varstr 7
  17. !    byte 4 == 40 -> max number of chars (hex 28) in varstr 8
  18. !    byte 5 == 40 -> max number of chars (hex 28) in varstr 9
  19. !    
  20. @ORIGINATE
  21. @ANSWER
  22. ! ---- Initial modem setup ----
  23. ! Start by opening up & resetting the serial port at the speed GlobalFax was using:
  24. serreset 19200, 0, 8, 1
  25. HSReset 0 0 0 0 0 0
  26. settries 0
  27. !
  28. ! If in Answer mode, leave port speed at 19.2 for Fax/ARA discrimination.
  29. ifANSWER 3
  30. ! In originate mode, set serial port speed depending upon the compression flag
  31. !    A higher rate with compression on (PPP) to handle expanded data from the modem
  32. !    A lower rate closer to the DCE when compression is off (ARA)
  33. ifstr 5 1 "0"
  34. serreset 115200, 0, 8, 1
  35. jump 2
  36. !
  37. @LABEL 1
  38. ! If in PPP mode, DTE is set to 115200, above.
  39. !
  40. ifANSWER 3
  41. !
  42. ! For outgoing ARA calls, bring the port speed up to just above max uncompressed data
  43. ! rate (for Teleport 33.6k, this would be 38400).
  44. !
  45. serreset 38400, 0, 8, 1
  46. !
  47. @LABEL 2
  48. hsreset 0 0 0 0 0 0
  49. settries 0
  50. !
  51. ! Get the modem's attention
  52. !
  53. matchclr
  54. matchstr 1 3 "OK\13\10"
  55. write "AT\13"
  56. matchread 30
  57. !
  58. @LABEL 3
  59. ! Setup the modem for the following:
  60. !   AT         Attention
  61. !   &F1        Reset to factory settings
  62. !              Standard compression/reliablity
  63. !              Lock serial port speed
  64. !              Serial port hardware handshaking, turn off software handshaking
  65. !   E0         Turn off AT command mode echo
  66. !   W2         CONNECT returns DCE speed
  67. !   S95=45     Verbose responses and compression/protocol results
  68. !   S0=0       Turn off answering
  69. !   &D3        Reset or return to command mode on DTR toggle (optional)
  70. !   S7=60      Allow 60 seconds for calls to complete
  71. !
  72. matchclr
  73. matchstr 1 4   "OK\13\10"
  74. matchstr 2 101 "ERROR\13\10"
  75. write "AT&F1E0W2S95=45S0=0&D3S7=60\13"
  76. matchread 30
  77. inctries
  78. iftries 3 101
  79. !
  80. ! Reset the Modem on setup failure
  81. !
  82. DTRClear
  83. pause 5
  84. DTRSet
  85. flush
  86. jump 3
  87. ! (Note, this was jump 1 in original GV TP Plat. 2.0 script).
  88. !
  89. !
  90. @LABEL 4
  91. ! Modem now responding and configured for full EC/DC functions.
  92. ! Varstring 4 , reliable link protocol:
  93. !    = 0, handled by computer (ARAP)
  94. !    = 1, handled by modem (PPP)
  95. !    = 2, MNP10 protocol (Cellular protocol, no longer supported)
  96. ! If PPP or Cellular mode, jump to 5, otherwise (ARA) disable EC/DC.
  97. ifstr 4 5 "1"
  98. ifstr 4 5 "2"
  99. !
  100. ! Varstring 4 == 0, turn off reliable link protocol in modem (ARAP)
  101. matchclr
  102. matchstr 1 9 "OK\13\10"
  103. write "AT\\N0\13"
  104. matchread 30
  105. jump 101
  106. !
  107. !
  108. @LABEL 5
  109. ! This is where MNP10 (or MNP10EC) could go, if/when we support that.
  110. ! Standard EC/DC is still on.  Decide whether to turn off DC.
  111. ! Varstring 5, compression protocol:
  112. !    = 0, handled by computer 
  113. !    = 1, handled by modem
  114. ifstr 5 9 "1"
  115. !
  116. ! Varstring 5 == 0, turn off compression protocol in modem.
  117. matchclr
  118. matchstr 1 9 "OK\13\10"
  119. write "AT%C0\13"
  120. matchread 30
  121. jump 101
  122. !
  123. !
  124. @LABEL 9
  125. ! If speaker on flag is true, jump to 13.  Otherwise, turn the speaker off.
  126. ! Varstring 2, modem speaker:
  127. !    = 0, speaker off
  128. !    = 1, speaker on
  129. ifstr 2 13 "1"
  130. pause 5
  131. matchclr
  132. matchstr 1 13 "OK\13\10"
  133. write "ATM0\13"
  134. matchread 30
  135. jump 101
  136. !
  137. ! Modem ready, wait for a call or originate a call
  138. !
  139. @LABEL 13
  140. ! In answer mode, jump out and set FAX/DATA discriminating auto-answer.
  141. ifANSWER 88
  142. !
  143. !
  144. ! ---- Originating a call ----
  145. ! For normal dialing, jump to 19.  Otherwise, manual dial jumps to 15, blind dial
  146. !    jumps to 17.
  147. ! Varstring 6, dialing mode:
  148. !    = 0, normal dialing
  149. !    = 1, blind dialing
  150. !    = 2, manual dialing
  151. ifstr 6 17 "1"
  152. ifstr 6 15 "2"
  153. jump 19
  154. !
  155. @LABEL 15
  156. ! Display ASK dialog with message.  Goto label 107 if dialog canceled.
  157. ASK 2 "Pick up the phone & dial ^1.  Hit OK when the phone rings, then hangup." 107
  158. note "Manual dialing initiated" 3
  159. ! X1S6=4 to ignore dialtone 4 seconds, & ignore busy, D to dial, \^ generates data tone
  160. write "ATX1S6=4D\^\13"
  161. jump 32
  162. !
  163. @LABEL 17
  164. note "Dialing without tone" 3
  165. matchclr
  166. matchstr 1 19 "OK\13\10"
  167. ! X1S6=4 to ignore dialtone 4 seconds, & ignore busy for blind dialing.
  168. write "ATX1S6=4\13"
  169. matchread 30
  170. jump 101
  171. !
  172. !
  173. @LABEL 19
  174. ! This is where we break up long dialstrings
  175. ! Display the full dialstring contained in Varstring 1
  176. note "Dialing ^1" 3
  177. !
  178. ! Varstrings 7, 8 and 9, contain dialstring fragments
  179. !    Long phone numbers may have been split into smaller groups
  180. !    so that the modem can use them
  181. ! Check to see whether these fragments exist.  If they do, dial them one at a time.
  182. ! If not, jump ahead and dial the remaining phone number.  Use the data tone.
  183. ! Varstring 3:  "p" for pulse & "t" for tone dialing
  184. ! Varstring 8 == blank (dialstring in varstring 7)
  185. ! Varstring 9 == blank (dialstring in varstrings 7 & 8)
  186. ! Otherwise (dialstring in varstrings 7, 8 & 9)
  187. ! \^ is added to the dialstring to force the modem to generate a data tone
  188. ifstr 8 27 " "
  189. ifstr 9 24 " "
  190. !
  191. !  Write dialstring in varstrings 7, 8 & 9
  192. matchclr
  193. matchstr 1 21 "OK\13\10"
  194. write "ATD^3\^^7;\13"
  195. matchread 400
  196. jump 101
  197. @LABEL 21
  198. matchclr
  199. matchstr 1 22 "OK\13\10"
  200. write "ATD^3^8;\13"
  201. matchread 400
  202. jump 101
  203. @LABEL 22
  204. write "ATD^3^9\13"
  205. jump 32
  206. !
  207. !
  208. @LABEL 24
  209. !  Write dialstring in varstrings 7 & 8
  210. matchclr
  211. matchstr 1 25 "OK\13\10"
  212. write "ATD^3\^^7;\13"
  213. matchread 400
  214. jump 101
  215. @LABEL 25
  216. write "ATD^3^8\13"
  217. jump 32
  218. !
  219. @LABEL 27
  220. !  Write dialstring in varstring 7
  221. write "ATD^3\^^7\13"
  222. !
  223. !
  224. !    ---- Connection response ----
  225. !
  226. ! The following section will parse modem responses of five types:
  227. !   1) PROTOCOL: xxx, COMPRESSION: xxx, CONNECT xxx
  228. !   2) CONNECT xxx/ARQ/V42
  229. !   3) Standard incoming and outgoing call progress messages
  230. !   4) FAX/DATA discrimination messages
  231. !   5) International DELAYED & BLACKLISTED restrictions.
  232. !
  233. @LABEL 32
  234. matchclr
  235. matchstr  1 81  "RING\13\10"
  236. matchstr  2 102 "NO DIALTONE\13\10"
  237. matchstr  3 103 "NO CARRIER"
  238. matchstr  4 103 "ERROR\13\10"
  239. matchstr  5 104 "BUSY\13\10"
  240. matchstr  6 105 "NO ANSWER\13\10"
  241. matchstr  7 33  "CONNECT "
  242. matchstr  8 32  "CARRIER"
  243. matchstr  9 40  "CONNECT\13\10"
  244. matchstr 10 62  "PROTOCOL: LAP"
  245. matchstr 11 62  "PROTOCOL: MNP"
  246. matchstr 12 62  "PROTOCOL: ALT"
  247. matchstr 13 67  "COMPRESSION: V"
  248. matchstr 14 67  "COMPRESSION: MNP5"
  249. matchstr 15 67  "COMPRESSION: CLASS"
  250. matchstr 16 82  "FAX\13\10"
  251. matchstr 17 84  "DATA\13\10"
  252. matchstr 18 110  "DELAYED  "
  253. matchstr 19 111  "BLACKLISTED\13\10"
  254. matchread 700
  255. ifANSWER 32
  256. jump 101
  257. !
  258. !  Parse the speed of connect result codes
  259. !  1200, 2400 and 4800 have two entries each
  260. !  to distinguish them from 12000, 24000 and 48000
  261. ! (added 1200bps support)
  262. !
  263. @LABEL 33
  264. matchclr
  265. matchstr  1 39 "1200\13"
  266. matchstr  2 39 "1200/"
  267. matchstr  3 40 "2400\13"
  268. matchstr  4 40 "2400/"
  269. matchstr  5 41 "4800\13"
  270. matchstr  6 41 "4800/"
  271. matchstr  7 42 "7200"
  272. matchstr  8 43 "9600"
  273. matchstr  9 44 "12000"
  274. matchstr 10 45 "14400"
  275. matchstr 11 46 "16800"
  276. matchstr 12 47 "19200"
  277. matchstr 13 48 "21600"
  278. matchstr 14 49 "24000"
  279. matchstr 15 50 "26400"
  280. matchstr 16 51 "28800"
  281. matchstr 17 52 "31200"
  282. matchstr 18 53 "33600"
  283. matchstr 19 54 "38400"
  284. matchstr 20 55 "48000"
  285. matchstr 21 56 "56000"
  286. matchstr 22 57 "57600"
  287. matchstr 23 58 "64000"
  288. matchread 30
  289. jump 59
  290. !
  291. ! -- Connection rates --
  292. ! CommunicatingAt informs ARA of the raw modem to modem
  293. ! connection speed.
  294. !
  295. @LABEL 39
  296. note "Communicating at 1200 bps." 2
  297. CommunicatingAt 1200
  298. jump 60
  299. !
  300. @LABEL 40
  301. note "Communicating at 2400 bps." 2
  302. CommunicatingAt 2400
  303. jump 60
  304. !
  305. @LABEL 41
  306. note "Communicating at 4800 bps." 2
  307. CommunicatingAt 4800
  308. jump 60
  309. !
  310. @LABEL 42
  311. note "Communicating at 7200 bps." 2
  312. CommunicatingAt 7200
  313. jump 60
  314. !
  315. @LABEL 43
  316. note "Communicating at 9600 bps." 2
  317. CommunicatingAt 9600
  318. jump 60
  319. !
  320. @LABEL 44
  321. note "Communicating at 12000 bps." 2
  322. CommunicatingAt 12000
  323. jump 60
  324. !
  325. @LABEL 45
  326. note "Communicating at 14400 bps." 2
  327. CommunicatingAt 14400
  328. jump 60
  329. !
  330. @LABEL 46
  331. note "Communicating at 16800 bps." 2
  332. CommunicatingAt 16800
  333. jump 60
  334. !
  335. @LABEL 47
  336. note "Communicating at 19200 bps." 2
  337. CommunicatingAt 19200
  338. jump 60
  339. !
  340. @LABEL 48
  341. note "Communicating at 21600 bps." 2
  342. CommunicatingAt 21600
  343. jump 60
  344. !
  345. @LABEL 49
  346. note "Communicating at 24000 bps." 2
  347. CommunicatingAt 24000
  348. jump 60
  349. !
  350. @LABEL 50
  351. note "Communicating at 26400 bps." 2
  352. CommunicatingAt 26400
  353. jump 60
  354. !
  355. @LABEL 51
  356. note "Communicating at 28800 bps." 2
  357. CommunicatingAt 28800
  358. jump 60
  359. !
  360. @LABEL 52
  361. note "Communicating at 31200 bps." 2
  362. CommunicatingAt 31200
  363. jump 60
  364. !
  365. @LABEL 53
  366. note "Communicating at 33600 bps." 2
  367. CommunicatingAt 33600
  368. jump 60
  369. !
  370. @LABEL 54
  371. note "Communicating at 38400 bps." 2
  372. CommunicatingAt 38400
  373. jump 60
  374. !
  375. @LABEL 55
  376. note "Communicating at 48000 bps." 2
  377. CommunicatingAt 48000
  378. jump 60
  379. !
  380. @LABEL 56
  381. note "Communicating at 56000 bps." 2
  382. CommunicatingAt 56000
  383. jump 60
  384. !
  385. @LABEL 57
  386. note "Communicating at 57600 bps." 2
  387. CommunicatingAt 57600
  388. jump 60
  389. !
  390. @LABEL 58
  391. note "Communicating at 64000 bps." 2
  392. CommunicatingAt 64000
  393. jump 60
  394. !
  395. @LABEL 59
  396. note "Communicating at an unknown rate." 2
  397. jump 60
  398. !
  399. ! Look for reliablilty and compression results 
  400. ! at the end of the connect result.
  401. !
  402. @LABEL 60
  403. matchclr
  404. matchstr  1 63 "LAPM"
  405. matchstr  2 63 "REL"
  406. matchstr  3 63 "ARQ"
  407. matchstr  4 68 "COMP/"
  408. matchstr  5 68 "COMP\13"
  409. matchstr  6 63 "V42/"
  410. matchstr  7 63 "V42\13"
  411. matchstr  8 68 "V42BIS"
  412. matchstr  9 68 "V42bis"
  413. matchstr 10 63 "MNP\13"
  414. matchstr 11 68 "MNP5"
  415. matchstr 12 70 "\10"
  416. matchread 30
  417. jump 70
  418. ! -- Modem error correction link negotiation --
  419. ! Userhook 2 informs ARA that a modem-to-modem error
  420. ! correcting protocol has been negotiated
  421. !
  422. !
  423. @LABEL 62
  424. note "Modem Reliable Link Established." 2
  425. userhook 2
  426. jump 32
  427. !
  428. @LABEL 63
  429. note "Modem Reliable Link Established." 2
  430. userhook 2
  431. jump 60
  432. !
  433. ! -- Compression negotiation --
  434. ! Userhook 3 informs ARA that a modem-to-modem compression
  435. ! protocol has been negotiated
  436. !
  437. @LABEL 67
  438. note "Modem Compression Established." 2
  439. userhook 3
  440. jump 32
  441. !
  442. @LABEL 68
  443. note "Modem Compression Established." 2
  444. userhook 3
  445. jump 60
  446. !
  447. !
  448. ! -- Normal exit after "CONNECT" --
  449. !
  450. !  This modem has been setup to do CTS handshaking,
  451. !  and we assume that a CTS handshaking cable is being used.
  452. !
  453. @LABEL 70
  454. ! Turn on CTS handshaking.
  455. HSReset 0 1 0 0 0 0
  456. !
  457. ifANSWER 71
  458. pause 30
  459. @LABEL 71
  460. exit 0
  461. !
  462. !
  463. ! ---- Answer calls ----
  464. !
  465. !    (Converted active ATA answering to a passive FAX/DATA discrimination method.)
  466. !
  467. @LABEL 81
  468. ifORIGINATE 32
  469. note "Answering phone..." 2
  470. jump 32
  471. @LABEL 82
  472. note "Answering Fax call..."
  473. matchclr
  474. matchstr 1 83 "CONNECT\13\10"
  475. matchread 100
  476. jump 101
  477. !
  478. @LABEL 83
  479. settries 1225
  480. sbreak
  481. pause 80
  482. note "A Fax call was received, but could not be answered."
  483. settries 0
  484. jump 95
  485. @LABEL 84
  486. ! Incoming call is DATA, not FAX.
  487. ! For GlobalFax, answering port speed was 19.2k. If compression is on (PPP), set
  488. ! a serial port speed of 115.2k. Otherwise, we're in ARA, so jump to 85.
  489. !
  490. !    Tell ARA to claim the serial port
  491. userhook 1
  492. ifstr 5 85 "0"
  493. serreset 115200, 0, 8, 1
  494. write "ATO\13"
  495. jump 32
  496. @LABEL 85
  497. ! Answering port speed is still 19.2k. Compression is off (ARA). Use 38.4k.
  498. serreset 38400, 0, 8, 1
  499. write "ATO\13"
  500. jump 32
  501. @LABEL 88
  502. ! Attempt to set Answer mode w/FAX/DATA discrimination, then go into wait mode.
  503. ! If the modem cannot do FAX/DATA discriminination, jump to 89.
  504. write "AT~GR0\13"
  505. pause 3
  506. matchclr
  507. matchstr 1 32 "OK\13\10"
  508. matchstr 2 89 "ERROR\13\10"
  509. write "AT+FAE=1S0=1\13"
  510. matchread 30
  511. @LABEL 89
  512. ! Set regular answer mode, for modems that don't do FAX/DATA discrimination.
  513. matchclr
  514. matchstr 1 32 "OK\13\10"
  515. write "ATS0=1\13"
  516. matchread 30
  517. jump 101
  518. ! ---- Hang up and reset modem ----
  519. !
  520. @HANGUP
  521. ! If we do this too long, exit.
  522. iftries 1225 99
  523. @LABEL 90
  524. settries 0
  525. HSReset 0 0 0 0 0 0
  526. !
  527. @LABEL 91
  528. ! Try to get control of the modem
  529. DTRClear
  530. Pause 5
  531. DTRSet
  532. flush
  533. !
  534. @LABEL 94
  535. ! Force a hangup
  536. matchclr
  537. matchstr 1 98 "NO CARRIER\13\10"
  538. matchstr 2 98 "OK\13\10"
  539. matchstr 3 98 "ERROR\13\10"
  540. matchstr 4 98 "0\13\10"
  541. matchstr 5 98 "DELAYED"
  542. matchstr 6 98 "BLACKLISTED"
  543. write "ATH\13"
  544. matchread 30
  545. ! Try again to get control of the modem by toggling DTR
  546. !
  547. @LABEL 95
  548. DTRClear
  549. Pause 5
  550. DTRSet
  551. flush
  552. !  Escape from data to command mode using standard +++ command
  553. matchclr
  554. matchstr 1 96 "OK\13\10"
  555. pause 15
  556. write "+++"
  557. matchread 15
  558. !
  559. !
  560. ! Try the hangup sequence three times otherwise declare an error
  561. inctries
  562. iftries 3 101
  563. jump 95
  564. !
  565. @LABEL 96
  566. !
  567. ! Pause between data and command mode
  568. !
  569. pause 50
  570. jump 94
  571. !
  572. !
  573. @LABEL 97
  574. ! AT&F1 resulted in Error, try again using AT&F
  575. pause 15
  576. matchclr
  577. matchstr 1 99 "OK\13\10"
  578. write "AT&FS0=0\13"
  579. matchread 30
  580. jump 101
  581. !
  582. @LABEL 98
  583. ! Got control of the modem.  Recall the factory settings.  If it fails, jump 97.
  584. pause 15
  585. matchclr
  586. matchstr 1 99 "OK\13\10"
  587. matchstr 2 97 "ERROR\13\10"
  588. write "AT&F1S0=0\13"
  589. matchread 30
  590. jump 101
  591. !
  592. @LABEL 99
  593. exit 0
  594. !
  595. ! ---- Error messages -----
  596. !
  597. ! Modem Not Responding
  598. @LABEL 101
  599. exit -6019
  600. !
  601. ! No Dial Tone
  602. @LABEL 102
  603. exit -6020
  604. !
  605. ! No Carrier or Error
  606. @LABEL 103
  607. exit -6021
  608. !
  609. ! Busy
  610. @LABEL 104
  611. exit -6022
  612. !
  613. ! No Answer
  614. @LABEL 105
  615. exit -6023
  616. !
  617. ! User Cancellation
  618. @LABEL 107
  619. exit -6008
  620. !
  621. ! ---- DELAYED and BLACKLISTED functions ----
  622. @LABEL 110
  623. matchclr
  624. matchstr  1 119 "00:00:0"
  625. matchstr  2 118 "00:00:1"
  626. matchstr  3 117 "00:00:2"
  627. matchstr  4 116 "00:00:3"
  628. matchstr  5 115 "00:00:4"
  629. matchstr  6 114 "00:00:5"
  630. matchstr  7 113 "00:01:"
  631. matchstr  8 112 "00:02:"
  632. matchread 30
  633. !  The number is 'DELAYED' more than 3 minutes.  Exit the script telling the user to wait or reset his modem.
  634. !
  635. exit -6019 "\13The modem responds 'DELAYED':\13(Cannot redial this number right now.)\13To try again immediately, turn modem OFF and ON before proceeding."
  636. @LABEL 111
  637. !  The number is 'BLACKLISTED'.  Exit the script, telling the user to reset his modem.
  638. exit -6019 "\13The modem responds 'BLACKLISTED':\13(Cannot redial this number again.)\13Double-check the number, then turn your modem OFF and ON before proceeding."
  639. !
  640. @LABEL 112
  641. note "'DELAYED'. Redialing in 3 minutes..."
  642. pause 600
  643. @LABEL 113
  644. note "'DELAYED'. Redialing in 2 minutes..."
  645. pause 600
  646. @LABEL 114
  647. note "'DELAYED'. Redialing in 1 minute... "
  648. pause 100
  649. @LABEL 115
  650. note "'DELAYED'. Redialing in 50 seconds..."
  651. pause 100
  652. @LABEL 116
  653. note "'DELAYED'. Redialing in 40 seconds..."
  654. pause 100
  655. @LABEL 117
  656. note "'DELAYED'. Redialing in 30 seconds..."
  657. pause 100
  658. @LABEL 118
  659. note "'DELAYED'. Redialing in 20 seconds..."
  660. pause 100
  661. @LABEL 119
  662. note "'DELAYED'. Redialing in 10 seconds..."
  663. pause 100
  664. jump 1
  665. ! Labels 121-128 are reserved for emergency hacks.
  666.